From 3e5ff3274b71363e80324b0bee6a0a3e406ab415 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 17 Mar 2005 14:08:58 +0000 Subject: [PATCH] bitkeeper revision 1.1236.34.12 (42398f7asEUKTar-hO4ZiDXWYTpyiA) Some small header-include cleanups. No need for BIGLOCK in dom_mem_op hypercall. Signed-off-by: Keir Fraser --- xen/arch/x86/smp.c | 6 ++---- xen/arch/x86/x86_emulate.c | 1 + xen/common/dom_mem_ops.c | 4 ---- xen/common/elf.c | 1 + xen/common/page_alloc.c | 3 ++- xen/common/xmalloc.c | 2 ++ xen/include/asm-x86/mm.h | 36 +++++++++--------------------------- xen/include/xen/sched.h | 12 +----------- 8 files changed, 18 insertions(+), 47 deletions(-) diff --git a/xen/arch/x86/smp.c b/xen/arch/x86/smp.c index 65b126c1e9..a56b85827c 100644 --- a/xen/arch/x86/smp.c +++ b/xen/arch/x86/smp.c @@ -8,9 +8,11 @@ * later. */ +#include #include #include #include +#include #include #include #include @@ -18,8 +20,6 @@ #include #include -#ifdef CONFIG_SMP - /* * Some notes on x86 processor bugs affecting SMP operation: * @@ -420,5 +420,3 @@ asmlinkage void smp_call_function_interrupt(void) atomic_inc(&call_data->finished); } } - -#endif /* CONFIG_SMP */ diff --git a/xen/arch/x86/x86_emulate.c b/xen/arch/x86/x86_emulate.c index fc1ad10122..7b959590f9 100644 --- a/xen/arch/x86/x86_emulate.c +++ b/xen/arch/x86/x86_emulate.c @@ -22,6 +22,7 @@ typedef int64_t s64; #include #include #include +#include #include #endif #include diff --git a/xen/common/dom_mem_ops.c b/xen/common/dom_mem_ops.c index 5d761d84dc..8547dcf701 100644 --- a/xen/common/dom_mem_ops.c +++ b/xen/common/dom_mem_ops.c @@ -142,8 +142,6 @@ do_dom_mem_op(unsigned long op, else if ( unlikely((d = find_domain_by_id(domid)) == NULL) ) return -ESRCH; - LOCK_BIGLOCK(d); - switch ( op ) { case MEMOP_increase_reservation: @@ -162,8 +160,6 @@ do_dom_mem_op(unsigned long op, if ( unlikely(domid != DOMID_SELF) ) put_domain(d); - UNLOCK_BIGLOCK(d); - return rc; } diff --git a/xen/common/elf.c b/xen/common/elf.c index 90e831d78a..74f1609392 100644 --- a/xen/common/elf.c +++ b/xen/common/elf.c @@ -9,6 +9,7 @@ #include #include #include +#include #ifdef CONFIG_X86 #define FORCE_XENELF_IMAGE 1 diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 90c122310e..b237332558 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -24,11 +24,12 @@ #include #include #include -#include +#include #include #include #include #include +#include /* * Comma-separated list of hexadecimal page numbers containing bad bytes. diff --git a/xen/common/xmalloc.c b/xen/common/xmalloc.c index a3ebc0c778..bb90cc392d 100644 --- a/xen/common/xmalloc.c +++ b/xen/common/xmalloc.c @@ -27,10 +27,12 @@ * (Disadvantage is potentially greater internal fragmentation). */ +#include #include #include #include #include +#include static LIST_HEAD(freelist); static spinlock_t freelist_lock = SPIN_LOCK_UNLOCKED; diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h index 8ba43abc69..d2d68e7cc2 100644 --- a/xen/include/asm-x86/mm.h +++ b/xen/include/asm-x86/mm.h @@ -4,18 +4,7 @@ #include #include -#include -#include -#include - -#include -#include -#include -#include #include -#include - -#include /* * Per-page-frame information. @@ -241,19 +230,11 @@ void synchronise_pagetables(unsigned long cpu_mask); */ #define __phys_to_machine_mapping ((unsigned long *)RO_MPT_VIRT_START) -/* Returns the machine physical */ -static inline unsigned long phys_to_machine_mapping(unsigned long pfn) -{ - unsigned long mfn; - l1_pgentry_t pte; - - if (__get_user(l1_pgentry_val(pte), (__phys_to_machine_mapping + pfn))) - mfn = 0; - else - mfn = l1_pgentry_to_phys(pte) >> PAGE_SHIFT; - - return mfn; -} +#define phys_to_machine_mapping(_pfn) \ +({ l1_pgentry_t l1e; unsigned long mfn; \ + mfn = __get_user(l1_pgentry_val(l1e), &__phys_to_machine_mapping[_pfn]) \ + ? 0 : l1_pgentry_to_pfn(l1e); \ + mfn; }) #define set_machinetophys(_mfn, _pfn) machine_to_phys_mapping[(_mfn)] = (_pfn) #define DEFAULT_GDT_ENTRIES (LAST_RESERVED_GDT_ENTRY+1) @@ -339,9 +320,10 @@ void audit_domains(void); void propagate_page_fault(unsigned long addr, u16 error_code); -/* update_grant_va_mapping - * Caller must own d's BIGLOCK, is responsible for flushing the TLB, - * and have already get_page'd */ +/* + * Caller must own d's BIGLOCK, is responsible for flushing the TLB, and must + * hold a reference to the page. + */ int update_grant_va_mapping(unsigned long va, unsigned long val, struct domain *d, diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index e240ea6f31..44f24831e8 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -89,19 +89,9 @@ struct exec_domain struct arch_exec_domain arch; }; -/* -** SMH: do_mmu_update() grabs big_lock and subsequently can fault -** on map_ldt_shadow_page(), enter do_page_fault() and then deadlock -** trying to reacquire big_lock. A temporary fix is to make big_lock -** recursive; overall probably needs more thought. -*/ -#if 0 -#define LOCK_BIGLOCK(_d) spin_lock(&(_d)->big_lock) -#define UNLOCK_BIGLOCK(_d) spin_unlock(&(_d)->big_lock) -#else +/* Per-domain lock can be recursively acquired in fault handlers. */ #define LOCK_BIGLOCK(_d) spin_lock_recursive(&(_d)->big_lock) #define UNLOCK_BIGLOCK(_d) spin_unlock_recursive(&(_d)->big_lock) -#endif struct domain { -- 2.30.2